package com.vp.org.util;

import com.alibaba.druid.pool.DruidDataSourceFactory;
import org.springframework.jdbc.core.JdbcTemplate;

import java.io.InputStream;
import java.util.Properties;

public class JdbcUtil {

    protected static JdbcTemplate template;

    static {
        Properties prop = new Properties();
        InputStream resource = JdbcUtil.class.getResourceAsStream("druid-config.properties");
        try {
            prop.load(resource);
            template = new JdbcTemplate(DruidDataSourceFactory.createDataSource(prop));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}